Introduction

Get an overview of the contents and understand the structure of this section.

We'll cover the following

It’s difficult to overstate the impact Kubernetes has had on the world of DevOps. Over the years since it was open-sourced by Google in 2014, Kubernetes has experienced a meteoric rise in popularity. In that period, Kubernetes has become the preeminent solution for orchestrating cloud-native container workloads, differentiating itself from a field of orchestrators such as Apache Mesos and Docker Swarm. By providing a common API over heterogeneous environments, Kubernetes has become the common tool for deploying applications across cloud and hybrid environments.

svg viewer

So, what is Kubernetes? According to its documentation, “Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services that facilitates both declarative configuration and automation.” That is a lot to unpack. Let’s sum up that statement a little differently. Kubernetes is a set of APIs and abstractions that make running containerize applications easier. It provides services such as service discovery, load balancing, storage abstraction and orchestration, automated rollouts and rollbacks, self-healing, and secret, certificate, and configuration management. Furthermore, if Kubernetes doesn't offer a specific bit of functionality we need directly, there is likely a solution available in the vibrant open-source ecosystem built around the core of Kubernetes. The Kubernetes ecosystem is a vast set of tools to achieve our operational objectives without needing to reinvent the wheel.

All of the aforementioned functionality is exposed through the Kubernetes API and is infinitely programmable.

This section will not be a deep dive into all aspects of Kubernetes. To properly explore Kubernetes in depth would require multiple books. The good news is there are many great books on the topic. Also, the fantastic community-driven documentation for Kubernetes is an invaluable resource for getting a deeper understanding of it.

The goal of this section is to provide a starting point for our journey in programming Kubernetes using Go. We will start by creating a simple Go program to deploy a Kubernetes resource to a local Kubernetes cluster to run a load-balanced HTTP service. We will then learn how to extend the Kubernetes API with custom resources to show how Kubernetes can be used to orchestrate and manage any external resource. We will build custom pet resources that will be stored in our pet store service running within the cluster to illustrate the concept of managing external resources. By the end of this section, we will be equipped with the knowledge to work effectively with the Kubernetes API and understand some of the core design principles of Kubernetes.

Technical requirements#

This section will require the following tools:

Structure#

We will cover the following topics in this section:

Summary and Quiz on Deploying and Building Applications in Kubernetes
Building a Pet Store Operator
Extending Kubernetes With Custom Resources and Operators
Deploying a Load-Balanced HTTP Application Using Go
Interacting With the Kubernetes API
Deploying and Building Applications in Kubernetes
Structure of this section

Summary and Quiz on Infrastructure as Code with Terraform

Interacting With the Kubernetes API